home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Pane2 / c / SetFlags < prev    next >
Text File  |  1995-08-23  |  2KB  |  62 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane2.SetFlags.c
  12.     Author:  Copyright © 1995 Andrew Sellors.
  13.     Version: 1.04 (4th August 1995)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. #include "DeskLib:Pane2.h"
  18. #include "Pane2Defs.h"
  19. #include "Desklib:Event.h"
  20. #include "DeskLib:Template.h"
  21. #include "Desklib:EventMsg.h"
  22. #include "Desklib:Error.h"
  23.  
  24. #include <stdlib.h>
  25.  
  26.  
  27. /******************************************************************************/
  28.  
  29. extern int Pane2_SetFlags(window_handle mainwindow, int panenumber, int flags)
  30. {
  31.  /*
  32.   * Sets flags of 'panenumber'th pane attached to the window 'main' or NULL
  33.   * if the 'panenumber' is invalid.
  34.   * First pane is number 1.
  35.   * Returns flags and if 'flags' is -1 then they are left unchanged
  36.   */
  37.   main_listelement *mainelement;
  38.   pane_listelement *paneelement;
  39.  
  40.  /*
  41.   * find element for main window and return NULL if mainwindow not present
  42.   */
  43.   mainelement = FindMainWindow(mainwindow);
  44.   if(mainelement == NULL)
  45.      return(NULL); /* not found */
  46.  
  47.  
  48.   paneelement = FindPaneWindow(mainelement, panenumber);
  49.   
  50.  
  51.   if(paneelement != NULL){
  52.  
  53.      if(flags != -1)
  54.         paneelement->paneflags.value = flags;
  55.  
  56.      return(paneelement->paneflags.value);
  57.  
  58.   }
  59.   else
  60.      return(NULL);
  61. }
  62.